import channelQ from "service/channelApi";

import request from "service/request";

export function checkToken() {
  return channelQ({
    url: "/channel/touch",
    method: "get",
  });
}

export function login(data) {
  return channelQ({
    url: "/channel/login",
    method: "POST",
    data,
  });
}

export function loginnew(data) {
  return channelQ({
    url: "/hz/login",
    method: "POST",
    data,
  });
}

export function updateBankInfo(data) {
  return channelQ({
    url: "/channel/updateBankAccountInfo",
    method: "POST",
    data,
  });
}

export function updatePassword(data) {
  return channelQ({
    url: "/channel/updatePassword",
    method: "POST",
    data,
  });
}

export function register(data) {
  return channelQ({
    url: "/channel/register",
    method: "POST",
    data,
  });
}
export function doctorInfo() {
  return channelQ({
    url: "/channel/queryChannelInfo",
    method: "get",
  });
}

export function apply(data) {
  return channelQ({
    url: "/channel/applyMyTeam",
    method: "POST",
    data,
  });
}

export function lowerChannel(params) {
  return channelQ({
    url: "/channel/listLowerChannel",
    method: "get",
    params,
  });
}

// /team/listLowerChannel请求方式：GET  将channel改为team
export function lowerChannel_n(params) {
  return channelQ({
    url: "/team/listLowerChannel",
    method: "get",
    params,
  });
}

export function users(params) {
  return channelQ({
    url: "/channel/users",
    method: "get",
    params,
  });
}

export function getChannelInfo(params) {
  // console.log(params)
  return channelQ({
    url: "/channel/getChannelInfo",
    method: "get",
    params,
  });
}

export function listChannelOrder(params) {
  return channelQ({
    url: "/channel/listChannelOrder",
    method: "get",
    params,
  });
}

/** 

新版渠道接口
**/

export function getChannelDetail(params) {
  return channelQ({
    url: "/channel/getChannelDetail",
    method: "get",
    params,
  });
}

export function getCreditInfo(params) {
  return channelQ({
    url: "/channel/creditInfo",
    method: "get",
    params,
  });
}

export function getUsersSalesInfo(params) {
  return channelQ({
    url: "/user/usersSalesInfo",
    method: "get",
    params,
  });
}

export function getFirstTeamInfo(params) {
  return channelQ({
    url: "/team/firstTeamInfo",
    method: "get",
    params,
  });
}

export function getSecondTeamInfo(params) {
  return channelQ({
    url: "/team/secondTeamInfo",
    method: "get",
    params,
  });
}

export function getMemberList(params) {
  return channelQ({
    url: "/user/listUserSalesInfo ",
    method: "get",
    params,
  });
}

export function getListChannelRedeem(params) {
  return channelQ({
    url: "/channel/listChannelRedeem",
    method: "get",
    params: {
      pageNum: 1 || option.pageNum,
      pageSize: 50 || option.pageSize,
    },
  });
}

//医生专用链接
export function setDoctor(params) {
  return request({
    url: "/user/doctor",
    method: "POST",
  });
}

export function getDoctorOrderList(params) {
  return channelQ({
    url: "/hz/listOrder",
    method: "get",
    params,
  });
}

export function getDoctorMemberList(params) {
  return channelQ({
    url: "/doctor/user/list",
    method: "get",
    params,
  });
}

export function getHomeData(params) {
  return channelQ({
    url: "/hz/statistics",
    method: "get",
    params,
  });
}
